package com.cuit.riskassessment.service.impl;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cuit.riskassessment.dao.isms.NewsManageMapper;
import com.cuit.riskassessment.service.NewsManageService;
import com.cuit.riskassessment.vo.News;
@Service(value="newsService")
public class NewsManageServiceImpl implements NewsManageService {
	@Autowired
	@Resource(name="newsManageMapper")
	private NewsManageMapper newsMapper;

	@Override
	public boolean addNews(News news) {
		return newsMapper.addControl(news)>0?true:false;
	}

	@Override
	public List<News> page(Integer start, Integer limit) {
		return newsMapper.getListControl(start, limit);
	}

	@Override
	public Object getTotalCount() {
		return newsMapper.getTotalCount();
	}

	@Override
	public void delNews(int[] ids) {
		for(int id:ids){
			newsMapper.delControl(id);
		}
	}

	@Override
	public boolean update(News news) {
		return newsMapper.updateControl(news)>0?true:false;
	}
	
}
